'use strict';
var Generator = require('yeoman-generator');
var chalk = require('chalk');
var yosay = require('yosay');

module.exports = Generator.extend({
  prompting: function () {
    // Have Yeoman greet the user.
    this.log(yosay(
      'Welcome to the epic ' + chalk.red('generator-mill-java') + ' generator!'
    ));

    var prompts = [{
        type:'input',
        name: 'annotationName',
        message: '您的注解名称',
        default: 'AnnotationDemo'
    },{
      type: 'checkbox',
      name: 'target',
      message: '注解的作用域?',
      choices: [{
        value: 'ElementType.TYPE',
        name: '类和接口或枚举',
        checked: true
      },
      {
        value: 'ElementType.FIELD',
        name: '字段',
        checked: false
      },
      {
        value: 'ElementType.METHOD',
        name: '方法',
        checked: false
      },
      {
        value: 'ElementType.CONSTRUCTOR',
        name: '构造器',
        checked: false
      },
      {
        value: 'ElementType.LOCAL_VARIABLE',
        name: '局部变量',
        checked: false
      },
      {
        value: 'ElementType.ANNOTATION_TYPE',
        name: '注解',
        checked: false
      },
      {
        value: 'ElementType.PACKAGE',
        name: '包',
        checked: false
      }
    
      ]
    },{
      type: 'checkbox',
      name: 'Retention',
      message: '您的注解在什么时候生效?',
      choices: [{
        value: 'CLASS',
        name: '存储在class中',
        checked: true
      },
      {
        value: 'RUNTIME',
        name: '允许反射',
        checked: true
      },
      {
        value: 'SOURCE',
        name: '不存储在class中',
        checked: false
      }
    
      ]
    }];

    return this.prompt(prompts).then(function (props) {
      // To access props later use this.props.someAnswer;
      this.props = props;
    }.bind(this));
  },
  config:function () {
    let path=this.config.get(annotaitionPath);
    if(!path){
      //路径不存在的情况下要写出路径
    }

  },
  writing: function () {
    
  },

  install: function () {

  }
});
